package com.kpmg.datalake.operatelog.model;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 通用操作日志
 * </p>
 *
 * @author azhao6
 * @since 2018-08-08
 */
@TableName("OPRT_LOG")
public class OperateLog implements Serializable {


    private static final long serialVersionUID = -7375809914368338840L;
    /**
     * 主键ID
     */
    @TableId(type = IdType.UUID)
    private String logId;
    /**
     * 日志所属模块
     */
    private String logModule;
    /**
     * 日志类型
     */
    private String logType;
    /**
     * 日志描述
     */
    private String logDesc;
    /**
     * 类名
     */
    private String className;
    /**
     * 方法名字
     */
    private String methodName;
    /**
     * 参数
     */
    private String requestParam;
    /**
     * 返回结果
     */
    private String requestResult;
    /**
     * 处理结果(成功失败)
     */
    private Integer requestStatus;
    /**
     * 请求用户名
     */
    private String userName;
    /**
     * 请求IP地址
     */
    private String ip;
    /**
     * 开始时间
     */
    private Date beginTime;
    /**
     * 完成时间
     */
    private Date endTime;
    /**
     * 耗时
     */
    private Long costTime;

    public String getLogId() {
        return logId;
    }

    public void setLogId(String logId) {
        this.logId = logId;
    }

    public String getLogModule() {
        return logModule;
    }

    public void setLogModule(String logModule) {
        this.logModule = logModule;
    }

    public String getLogType() {
        return logType;
    }

    public void setLogType(String logType) {
        this.logType = logType;
    }

    public String getLogDesc() {
        return logDesc;
    }

    public void setLogDesc(String logDesc) {
        this.logDesc = logDesc;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public String getRequestParam() {
        return requestParam;
    }

    public void setRequestParam(String requestParam) {
        this.requestParam = requestParam;
    }

    public String getRequestResult() {
        return requestResult;
    }

    public void setRequestResult(String requestResult) {
        this.requestResult = requestResult;
    }

    public Integer getRequestStatus() {
        return requestStatus;
    }

    public void setRequestStatus(Integer requestStatus) {
        this.requestStatus = requestStatus;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public Date getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(Date beginTime) {
        this.beginTime = beginTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Long getCostTime() {
        return costTime;
    }

    public void setCostTime(Long costTime) {
        this.costTime = costTime;
    }

    @Override
    public String toString() {
        return getClass().getName() + JSONObject.toJSONString(this);
    }
}
